#include<stdio.h>
struct Mooncake
{
	double inventory;
	double total_price;
	double price_per_ton;
};
int main()
{
	int n;
	double d;
	scanf("%d %lf",&n,&d);
	struct Mooncake moon[20];
	for(int i=0;i<n;i++)
	{
		scanf("%lf",&moon[i].inventory);
	}
	for(int i=0;i<n;i++)
	{
		scanf("%lf",&moon[i].total_price);
		moon[i].price_per_ton=moon[i].total_price/moon[i].inventory;
	}
	for(int i=0;i<n-1;i++)
	{
		for(int j=0;j<n-i-1;j++)
		{
			if(moon[j].price_per_ton<moon[j+1].price_per_ton)
			{
				struct Mooncake temp=moon[j];
				moon[j]=moon[j+1];
				moon[j+1]=temp;
			}
		}
	}
	int k=0;
	double sum=0;
	while(d>0&&k<n)
	{
		if(d-moon[k].inventory>=0)
		{
			d=d-moon[k].inventory;
			sum=sum+moon[k].total_price;
		}
		else
		{
			sum=sum+d*moon[k].price_per_ton;
		    break; 
		}
		k++;
	}
	printf("%.2lf",sum);
	return 0;
}
